Page({
	data: {
		iconList: [{
				icon: 'my',
				color: 'orange',
				badge: 0,
				name: '用户管理',
				url: "/pages/adminUser/userList/userList"
			}, {
				icon: 'form',
				color: 'orange',
				badge: 0,
				name: '小知识管理',
				url: "/pages/adminComm/commList/commList"
			},
			{
				icon: 'goods',
				color: 'orange',
				badge: 0,
				name: '兑换管理',
				url: "/pages/adminGoods/goodsList/goodsList"
			},
			{
				icon: 'comment',
				color: 'orange',
				badge: 0,
				name: '用户反馈',
				url: "/pages/adminFeedback/feedbackList/feedbackList"
			},
			{
				icon: 'text',
				color: 'orange',
				badge: 0,
				name: '答题管理',
				url: "/pages/adminAnswer/adminAnswer"
			}
		]

	},
	onShow() {
		this.getUserFeedbackNoreadNum()
	},
	ItenClick(e) {
		let url = e.currentTarget.dataset.url
		wx.navigateTo({
			url: url
		})
	},
	getUserFeedbackNoreadNum() {
		wx.cloud.callFunction({
			name: 'db',
			data: {
				$url: "getUserFeedbackNoreadNum"
			}
		}).then(res => {
			let result = res.result
			let info = this.data.iconList.find((item) => item.icon == 'comment')
			if (info) {
				info.badge = result.data
			}
			this.setData({
				iconList: this.data.iconList
			})
		})
	}
})